package cdc.retrofit.official.errorhandle;

import java.io.IOException;
/** A callback which offers granular callbacks for various conditions. 
 * 为各种条件提供粒度回调的回调。
 * */
import retrofit2.Response;

public interface MyCallback<T> {
	 /** Called for [200, 300) responses. */
    void success(Response<T> response);
    /** Called for 401 responses. */
    void unauthenticated(Response<?> response);
    /** Called for [400, 500) responses, except 401. */
    void clientError(Response<?> response);
    /** Called for [500, 600) response. */
    void serverError(Response<?> response);
    /** Called for network errors while making the call. */
    void networkError(IOException e);
    /** Called for unexpected errors while making the call. */
    void unexpectedError(Throwable t);

}
